 <div class="container" >

<!-- Page-Title -->
                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="pull-left page-title"><b>报警设置</b></h4>
                                <ol class="breadcrumb pull-right">
                                    <li><a href="#">首页</a></li>
                                    <li class="active">报警设置</li>
                                </ol>
                            </div>
                        </div>
	
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-body">
                        <div class="row">
                        <div class="col-md-8">
                        	<button  ng-if="edit_cmp" class="btn btn-primary waves-effect waves-light" data-toggle="modal" data-target="#add-alarm-modal">添加 <i class="fa fa-plus"></i></button>
                        </div>
                            <div class="input-group col-md-4">
                                <span class="input-group-btn">
                                <button type="button" class="btn waves-effect waves-light btn-primary" btn-loading="loadCtl.search" ng-click="init()" >查询<i class="fa fa-search"></i></button>
                                </span>
                                <input type="text" ng-model="quereyData.name"  class="form-control" placeholder="按名称查找" />
                            </div>
                        </div>
					<div class="row">
						<div class="col-md-12 col-sm-12 col-xs-12">
							<div class="table-responsive">
								<table class="table">
									<thead>
									<tr>
										<th>名称</th>
										<th>数据模版名称</th>
										<th>数据点名称</th>
										<th>触发条件</th>
										<th ng-if="edit_cmp">操作</th>
									</tr>
									</thead>
									<tbody>
									<tr ng-repeat="alarm in alarmSettings"> 
									<td>{{ alarm.name }}</td>
									<td>{{ alarm.modelName}}</td>
									<td>{{ alarm.attrName }}</td>
									<td>{{ alarm.alramTypeFmt }}</td>
									<td ng-if="edit_cmp"> 
										<a href="javascript:void(0)" ng-if="false" class="operation" title="详情" data-toggle="modal" data-target="#equ-info-modal" ng-click="selEquInfo(eqm)"><i class="ion-information-circled"></i></a>
										<a href="javascript:void(0)" ng-click="seleEdit(alarm)" data-toggle="modal" data-target="#alarm-edit-modal" class="operation" title="编辑"><i class="fa fa-pencil"></i></a>
										<a href="javascript:void(0)" class="operation" ng-click="delEqu(alarm.id)" title="删除"><i class="fa fa-trash-o"></i></a>
								   </td>
									</tr>
									

									</tbody>
								</table>
							</div>
						</div>
						 <!-- 分页 -->
                        <page-info pages="pages" curpage="quereyData.page" change="changePage(page)" total="total"></page-info>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="equ-info-modal" class="modal fade" tabindex="-1" role="dialog"  aria-hidden="true" style="display: none">
         <div class="modal-dialog"> 
             <div class="modal-content"> 
                 <div class="modal-header"> 
                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="closeEquModal()">×</button> 
                     <h5 class="modal-title">设备详情</h5> 
                 </div> 
                 <div class="modal-body" >
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">设备名称：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.name}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">设备编号：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.devId}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">设备类型：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.typeName}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">数据模板：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.modelName}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">所属分组：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.groupName}}</div>
			        </div>
               		<div class="form-group clearfix" ng-if="seleItem.typeCd=='N'">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">所属应用：</label>
				        <div class="col-sm-7 ng-binding">{{$parent.seleItem.appName}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">所属用户：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.uName}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">设备地址：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.address}}<em class="info_em">{{seleItem.site}}</em></div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">验证码：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.verification}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">厂商ID：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.supportCode}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">厂商名称：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.supporter}}</div>
			        </div>
               		<div class="form-group clearfix">
				        <label class="col-sm-5 control-label ng-binding" style="text-align: right">备注：</label>
				        <div class="col-sm-7 ng-binding">{{seleItem.remark}}</div>
			        </div>
                 </div> 
             </div> 
         </div>
     </div>
	<div id="add-alarm-modal" class="modal fade" tabindex="-1" role="dialog"  aria-hidden="true" style="display: none">
         <div class="modal-dialog"> 
             <div class="modal-content"> 
                 <div class="modal-header"> 
                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="clearAddModal()">×</button> 
                     <h5 class="modal-title">添加</h5> 
                 </div> 
                 <div class="modal-body" >
                 <form class="form-horizontal" ng-submit="addAlarm()" name="addAlarmForm" novalidate="novalidate">
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">名称<span style="color : red">*</span></label>  
							  <div class="col-md-6">
	                                <input type="text" class="form-control" name="name" ng-model="addFrom.name" required >
                              </div>
                         </div>
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">所属数据模板<span style="color : red">*</span></label>  
							  <div class="col-md-6">
	                               <select  class="form-control" name="modelId"  ng-model="addFrom.modelId" ng-change="seledModel(addFrom.modelId)" ng-options="x for (x, y) in selModels" required>
									</select>
                              </div>
                         </div> 
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">所属数据点<span style="color : red">*</span></label>  
							  <div class="col-md-6">
	                               <select  class="form-control" name="uid"  ng-model="addFrom.attrId"  ng-options="x for (x, y) in selAttrs" required>
									</select>
                              </div>
                         </div> 
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">报警条件<span style="color : red">*</span></label>  
							  <div class="col-md-4">
	                                <select class="form-control" name="alramType" ng-change="addTypeChg()" ng-model="addFrom.alramType" required>
									<option  value="SOFF">开关OFF</option>
									<option  value="SON">开关ON</option>
									<option  value="LA">数值低于A</option>
									<option  value="HB">数值高于B</option>
									<option  value="BAB">数值介于AB之间</option>
									<option  value="OAB">数值高于B低于A</option>
									<option  value="EA">数值等于A</option>
								</select>
                              </div>
							  <div class="col-md-2" ng-if="addFrom.alramType=='LA' || addFrom.alramType=='BAB' || addFrom.alramType=='OAB' || addFrom.alramType=='EA'">
	                                <input type="text"  
	                                 class="form-control" placeholder="A" ng-model="$parent.addFrom.dataA" required >
                              </div>
							  <div class="col-md-2" ng-if="addFrom.alramType=='HB' || addFrom.alramType=='BAB'|| addFrom.alramType=='OAB'">
	                                <input type="text"  
	                                class="form-control" placeholder="B" ng-model="$parent.addFrom.dataB" required >
                              </div>
                              
                         </div> 
						<div class="modal-footer">
						<button id="close-add-alarm-modal" type="button" class="btn btn-default waves-effect" data-dismiss="modal" ng-click="clearAddModal()" >关闭</button> 
	                     <button type="submit" class="btn btn-info waves-effect waves-light" ng-disabled="addAlarmForm.$invalid " btn-loading="loadCtl.addEnq">保存</button> 
		                </div>
                   </form>
                 </div> 
             </div> 
         </div>
     </div>
	<div id="alarm-edit-modal" class="modal fade" tabindex="-1" role="dialog"  aria-hidden="true" style="display: none">
         <div class="modal-dialog"> 
             <div class="modal-content"> 
                 <div class="modal-header"> 
                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="clearEditModal()">×</button> 
                     <h5 class="modal-title">修改</h5> 
                 </div> 
                 <div class="modal-body" >
                 <form class="form-horizontal" ng-submit="editAlarm()" name="editAlarmForm" novalidate="novalidate">
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">名称<span style="color : red">*</span></label>  
							  <div class="col-md-6">
	                                <input type="text" class="form-control" name="name" ng-model="editFrom.name" required >
                              </div>
                         </div>
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">所属数据模板<span style="color : red">*</span></label>  
							  <div class="col-md-6">
	                               <select  class="form-control" name="modelId"  ng-model="editFrom.modelId" ng-change="seledModel(editFrom.modelId)" ng-options="x for (x, y) in selModels" required>
									</select>
                              </div>
                         </div> 
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">所属数据点<span style="color : red">*</span></label>  
							  <div class="col-md-6">
	                               <select  class="form-control" name="uid"  ng-model="editFrom.attrId"  ng-options="x for (x, y) in selAttrs" required>
									</select>
                              </div>
                         </div> 
                         <div class="form-group "> 
                              <label  class="col-md-4 control-label ">报警条件<span style="color : red">*</span></label>  
							  <div class="col-md-4">
	                                <select class="form-control" name="alramType" ng-change="editTypeChg()" ng-model="editFrom.alramType" required>
									<option  value="SOFF">开关OFF</option>
									<option  value="SON">开关ON</option>
									<option  value="LA">数值低于A</option>
									<option  value="HB">数值高于B</option>
									<option  value="BAB">数值介于AB之间</option>
									<option  value="OAB">数值高于B低于A</option>
									<option  value="EA">数值等于A</option>
								</select>
                              </div>
							  <div class="col-md-2" ng-if="editFrom.alramType=='LA' || editFrom.alramType=='BAB' || editFrom.alramType=='OAB' || editFrom.alramType=='EA'" >
	                                <input type="text"  class="form-control" placeholder="A" ng-model="$parent.editFrom.dataA" required >
                              </div>
							  <div class="col-md-2" ng-if="editFrom.alramType=='HB' || editFrom.alramType=='BAB'|| editFrom.alramType=='OAB'" >
	                                <input type="text" class="form-control" placeholder="B" ng-model="$parent.editFrom.dataB" required >
                              </div>
                              
                         </div> 
						<div class="modal-footer">
						<button id="close-edit-alarm-modal" type="button" class="btn btn-default waves-effect" data-dismiss="modal" ng-click="clearEditModal()" >关闭</button> 
	                     <button type="submit" class="btn btn-info waves-effect waves-light" ng-disabled="editAlarmForm.$invalid " btn-loading="loadCtl.editEnq">保存</button> 
		                </div>
                   </form>
                 </div> 
             </div> 
         </div>
     </div>
     
</div>